The present invention generally relates to the processing of graphics data, and particularly relates to methods and apparatus for compressing frame buffer data in a three-dimensional (3D) graphics rendering system.
3D graphics rendering systems typically utilize several memory buffers during the rendering process, such as texture buffers, depth buffers (often called z-buffers), and color buffers. These buffers often are stored in random-access memory (RAM) external to the graphics processing unit (GPU), which may have relatively small cache memories on board. Because the buffered data may be retrieved and re-written several times during the rendering process, the memory bandwidth (the capacity for writing data to memory and reading data from memory) must often be quite high, especially to support real-time graphics processing applications such as real-time games. On a desktop personal computer, the available memory bandwidth might be very high, perhaps several gigabytes per second. In a mobile phone, several hundred megabytes per second of data transfer might be available.
Even with these high available memory bandwidths, the performance of a GPU might nonetheless be constrained by the memory bandwidth. Reducing the amount of data retrieved from and written to the external RAM is thus generally advantageous. The advantages of reducing memory transactions are particularly pronounced in mobile platforms, such as a mobile telephone, since the increased clock rates and wider data buses required to support very high memory bandwidths also result in increased power consumption, draining batteries more quickly.
Data compression is one approach to reducing the memory bandwidth required to support advanced 3D rendering applications. Lossless data compression techniques, which permit the reconstruction of the original data without any loss of information, are sometimes used today in 3D graphics rendering applications. Lossy data compression algorithms, which can provide significantly higher compression ratios but which may result in the introduction of visual artifacts in the reconstructed data, are commonly used in video applications, such as digital television, but appear to have been neglected with respect to compressing the color buffer in 3D rendering applications.
One reason for avoiding lossy compression schemes in 3D rendering applications is that it is possible to introduce large errors into the color buffer data when lossy compression is used several times. The need for repeated compression and decompression operations distinguishes many 3D graphics rendering applications from digital video applications, for instance, where a given frame is typically compressed just once. Some or all of the color buffer data for a single frame may be compressed and decompressed several times during the graphics rendering process. In a triangle-based 3D rendering system, for example, several triangles may be successively written to a segment (e.g., a tile, or block) of data. Each time, the segment of data may be retrieved from the frame buffer, decompressed, processed, compressed again, and written back to the color buffer. If lossy compression is used to compress the data segment each time, this tandem compression may result in repeated losses of information, introducing unacceptable errors into the final data.